package com.study;

import com.study.common.domin.User;
import com.study.service.UserService;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit.jupiter.SpringExtension;

import java.util.List;

/**
 * @Description: TODO
 * @Author: csc
 * @Date: 2024/8/16 10:35
 * @Version: 1.0
 **/

@ExtendWith(SpringExtension.class)
@SpringBootTest
public class Ceshi {

    @Autowired
    private UserService userService;

    @Test
    public void test(){
        for (int i = 0; i <10 ; i++) {
            List<User> list = userService.list();
            list.forEach(System.out::println);
        }
    }


    @Test
    public void addUser(){

        User user = new User();
        user.setName("漩涡鸣人");
        user.setAge(12000);
        user.setEmail("漩涡鸣人@qq.com");
        boolean save = userService.saveOrUpdate(user);
        System.out.println(save);

    }

}
